package config

import baseConfig "gitee.com/zaiqiang231/go-base-app/base_app/config"

var (
	GlobalAppConfig = new(AppConfig)
	ServiceName     = "lovesport-user-service"
)

var (
	AuthIdentityKey = "username"
)

type AppConfig struct {
	baseConfig.AppConfig `mapstructure:",squash"` //结构体的字段提到父结构中
	RedisConfig          *RedisConfig             `mapstructure:"redis"`
	CaptchaConfig        *CaptchaConfig           `mapstructure:"captcha"`
	UploadConfig         *UploadConfig            `mapstructure:"upload"`
}

type RedisConfig struct {
	Addr     string `mapstructure:"addr"`
	Password string `mapstructure:"password"`
}

type CaptchaConfig struct {
	KeyLong            int `mapstructure:"key-long"`
	ImgWidth           int `mapstructure:"img-width"`
	ImgHeight          int `mapstructure:"img-height"`
	OpenCaptcha        int `mapstructure:"open-captcha"`
	OpenCaptchaTimeOut int `mapstructure:"open-captcha-timeout"`
}

type UploadConfig struct {
	PicturePath      string `mapstructure:"picture-path"`
	PictureStorePath string `mapstructure:"picture-store-path"`
}
